﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using FbKPI.Model;
using FbKPI.Controller;

namespace FbKPI.Facade
{
    public class KPIAttachmentFacade
    {        
        public string Save(KPIAttachment KPIAttachments)
        {
            KPIAttachmentController cont = new KPIAttachmentController();
            return cont.Save(KPIAttachments);
        }

        public string Delete(KPIAttachment KPIAttachments)
        {
            KPIAttachmentController cont = new KPIAttachmentController();
            return cont.Delete(KPIAttachments);
        }

        public IList<KPIAttachment> GetKPIAttachmentByKPIAssign(int KPIAssignID, int month, int year)
        {
            IList<KPIAttachment> Attachments = new List<KPIAttachment>();
            KPIAttachmentController cont = new KPIAttachmentController();
            Attachments = cont.GetKPIAttachmentByKPIAssign(KPIAssignID, month, year);
            return Attachments;
        }

        public IList<KPIAttachment> GetKPIAttachmentByKPIAssign_ByKpiId_KpiAssign_KpiAssignDtl(int KPIID, int KPIAssignID, int KPIAssignDetailID)
        {
            IList<KPIAttachment> Attachments = new List<KPIAttachment>();
            KPIAttachmentController cont = new KPIAttachmentController();
            Attachments = cont.GetKPIAttachmentByKPIAssign_ByKpiId_KpiAssign_KpiAssignDtl(KPIID, KPIAssignID, KPIAssignDetailID);
            return Attachments;
        }

        public IList<KPIAttachment> GetKPIAttachmentByKPIAssign_KpiAssign(int KPIAssignID)
        {
            IList<KPIAttachment> Attachments = new List<KPIAttachment>();
            KPIAttachmentController cont = new KPIAttachmentController();
            Attachments = cont.GetKPIAttachmentByKPIAssign_ByKpiId_KpiAssign_KpiAssignDtl(KPIAssignID);
            return Attachments;
        }

        public IList<KPIAttachment> GetKPIAttachment_ByKpiId(int KpiId)
        {
            IList<KPIAttachment> Attachments = new List<KPIAttachment>();
            KPIAttachmentController cont = new KPIAttachmentController();
            Attachments = cont.GetKPIAttachment_ByKpiId(KpiId);
            return Attachments;
        }

        public IList<KPIChildAttachment> GetKPIChildAttachment(KPI KPI, int year, Employee User)
        {
            IList<KPIChildAttachment> Attachments = new List<KPIChildAttachment>();
            KPIAttachmentController cont = new KPIAttachmentController();
            Attachments = cont.GetKPIChildAttachment(KPI, year, User);
            return Attachments;
        }

        public KPIAttachment GetKPIAttachmentById(int ID)
        {
            KPIAttachmentController cont = new KPIAttachmentController();
            return cont.GetKPIAttachmentByID(ID);
        }
    }
}